function Person(name,age,gender){
    this.name = name;
    this.age = age;
    this.gender = gender;
    if(typeof this.sayName != 'function'){
        Person.prototype.sayName = function(){
            console.log(this.name);
        }
    }
}
var person = new Person('moyu',23,'female')
person.sayName()
